package com.pozhu.native_egl;

import androidx.appcompat.app.AppCompatActivity;

import android.Manifest;
import android.app.NativeActivity;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.widget.TextView;

import com.pozhu.native_egl.databinding.ActivityMainBinding;

public class NativeEGLActivity extends NativeActivity {

    // Used to load the 'native_egl' library on application startup.
    static {
        System.loadLibrary("native_egl");
    }

    private ActivityMainBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        //给与权限
        ensureStoragePermissionGranted();

    }
    public boolean ensureStoragePermissionGranted() {
        if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
            return true;
        } else {
            requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1234);
            return false;
        }
    }


}